package com.adingxiong.springsecurityoauth2.result;

import java.io.Serializable;
import java.util.HashMap;

/**
 * @ClassName Response
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/10/29 13:24
 **/
public class Response extends HashMap<String,Object> implements Serializable {

    public Response message(String message){
        this.put("message",message);
        return  this;
    }

    public Response data(Object data){
        this.put("data",data);
        return this;
    }

    @Override
    public Response put(String key ,Object value){
        super.put(key,value);
        return this;
    }

    public String getMessage(){
        return String.valueOf(get("message"));
    }

    public Object getData(){
        return get("data");
    }
}
